﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
   CodeBehind="Home.aspx.cs" Inherits="JohnnySins.Admin.Home" %>
<%@ Register TagName="FtpVideoChoise" Src="~/Controls/FtpVideoChoice.ascx" TagPrefix="john"  %>
<%@ Register TagName="CustomFileUpload" Src="~/Controls/CustomFileUpload.ascx" TagPrefix="john"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
   <script type="text/javascript">
      $(function () {
         $("#editDialog").dialog({ modal: true, autoOpen: false, width: 800, resizable: false });
         $("#editDialog").parent().appendTo(jQuery("form:first"));

         $("#editNextLiveShow").dialog({ modal: true, autoOpen: false, width: 800, resizable: false });
         $("#editNextLiveShow").parent().appendTo(jQuery("form:first"));

         $(".ui-dialog-titlebar").hide();


         Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
            $.datepicker.setDefaults($.datepicker.regional[""]);
            $("#<%= txtNextLiveShowDate.ClientID %>").datepicker($.datepicker.regional["en-GB"]);

            $("#<%= txtNextLiveShowDate.ClientID %>").datepicker({
               showmonth: true,
               autoSize: true,
               showAnim: 'slideDown',
               duration: 'fast'
           });

           $('#<%= txtNextLiveShowTime.ClientID %>').timepicker();

            $("#btnShowDate").click(function () {
                $("#<%= txtNextLiveShowDate.ClientID %>").datepicker('show');
            });
            $("#btnShowTime").click(function () {
                $('#<%= txtNextLiveShowTime.ClientID %>').datepicker('show');
            });
         });
      });

      function createUpdateForm(id) {
         __doPostBack('upDetails', id);
     }
     function createNextLiveShowUpdateForm(id) {
         __doPostBack('upNextLiveShowDetails', id);
     }
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   <john:FtpVideoChoise ID="ctrlFtpChoise"  runat="server" />

   <div class="page_title">
      <h1>Home</h1>
   </div>
   <div class="row">
   <div class="col-sm-6 col-md-6 col-lg-4">
         <div class="display_inputbox_panel">
            <h4>Next Live Show</h4>
            <asp:UpdatePanel runat="server" ID="upNextLiveShow" UpdateMode="Conditional">
                <ContentTemplate>  
                <div class="table-responsive">
                   <asp:GridView ID="gridNextLiveShow" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                      AllowPaging="False" PageSize="20" OnRowDataBound="gridNextLiveShow_RowDataBound" OnRowCommand="gridNextLiveShow_Command">
                      <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"
                         FirstPageText="<<" LastPageText=">>" />
                      <Columns>
                         <asp:TemplateField HeaderText="Name">
                            <ItemTemplate>
                               <asp:Label ID="lblName" Text='<%# Eval("NextLiveShowName") %>' runat="server" />
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Date">
                            <ItemTemplate>
                               <asp:Label ID="lblDate" Text='<%# Convert.ToDateTime(Eval("NextLiveShowDate")).ToString("MM.dd.yyyy HH:mm") %>' runat="server" />
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Status">
                            <ItemTemplate>
                               <asp:Label ID="lblStatus" Text='<%# Eval("Status") %>' runat="server" />
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Action">
                            <ItemTemplate>
                                <a href='javascript:void(0)' onclick="javascript:createNextLiveShowUpdateForm(<%#Eval("NextLiveShowId")%>);">
                                    <img src="<%=ResolveClientUrl("~") %>images/admin/action_icon/edit_icon.png" alt="" title="Edit" border="0" />
                                </a>
                               <asp:ImageButton runat="server" ImageUrl="~/images/admin/action_icon/delete_icon.gif" ToolTip="Delete"
                                  Style="vertical-align: middle;" ID="lbtnDelete" OnCommand="gridNextLiveShow_Command" CommandName="delete"
                                  CommandArgument='<%# Eval("NextLiveShowId")%>' OnClientClick="return confirm('Please confirm if you want to delete next live show info')" />
                               <asp:ImageButton ID="btnDeactivate" OnCommand="gridNextLiveShow_Command" ToolTip="Deactivate"
                                  Style="vertical-align: middle;" CommandName="deactivate" CommandArgument='<%# Eval("NextLiveShowId")%>'
                                  runat="server" OnClientClick="return confirm('Please confirm if you want to deactivate next live show info')"
                                  ImageUrl="~/images/admin/action_icon/deactive.png" />
                               <asp:ImageButton ID="btnActivate" OnCommand="gridNextLiveShow_Command" ToolTip="Activate" Style="vertical-align: middle;"
                                  CommandName="activate" CommandArgument='<%# Eval("NextLiveShowId")%>' runat="server"
                                  OnClientClick="return confirm('Please confirm if you want to next live show info')"
                                  ImageUrl="~/images/admin/action_icon/logout.png" />
                            </ItemTemplate>
                         </asp:TemplateField>
                      </Columns>
                   </asp:GridView>
                </div>
                </ContentTemplate>
                <Triggers>
                </Triggers>
            </asp:UpdatePanel>
            <div class="button_group">
                <div class="row">
                    <div class="col-sm-6 col-lg-5">
                        <asp:Button ID="btnAddNextLiveShow" Text="Add New" runat="server" OnClientClick="createNextLiveShowUpdateForm(-1); return false;" CssClass="btn btn-default" />
                    </div>
                    <div class="col-sm-6 col-lg-7">
               
                    </div>
                </div>
            </div>
        </div>
   </div>
   
   <div class="col-sm-6 col-md-6 col-lg-4">
      <div class="display_inputbox_panel">
         <h4>Image Banner</h4>
         <asp:UpdatePanel ID="upBanner" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
            <div class="table-responsive">
               <asp:GridView ID="gridBanner" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                  AllowPaging="False" PageSize="20" OnRowDataBound="gridBanner_RowDataBound" OnRowCommand="gridBanner_Command">
                  <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"
                     FirstPageText="<<" LastPageText=">>" />
                  <Columns>
                     <asp:TemplateField HeaderText="Banner File">
                        <ItemTemplate>
                           <asp:Label ID="lblBannerFileName" Text='<%# Eval("BannerFileName") %>'
                              runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                           <asp:Label ID="lblStatus" Text='<%# Eval("Status") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Action">
                        <ItemTemplate>
                           <asp:ImageButton runat="server" ImageUrl="~/images/admin/action_icon/delete_icon.gif" ToolTip="Delete"
                              Style="vertical-align: middle;" ID="lbtnDelete" OnCommand="gridBanner_Command" CommandName="deleteBanner"
                              CommandArgument='<%# Eval("BannerId")%>' OnClientClick="return confirm('Please confirm if you want to delete banner')" />
                           <asp:ImageButton ID="btnDeactivate" OnCommand="gridBanner_Command" ToolTip="Deactivate"
                              Style="vertical-align: middle;" CommandName="deactivate" CommandArgument='<%# Eval("BannerId")%>'
                              runat="server" OnClientClick="return confirm('Please confirm if you want to deactivate banner')"
                              ImageUrl="~/images/admin/action_icon/deactive.png" />
                           <asp:ImageButton ID="btnActivate" OnCommand="gridBanner_Command" ToolTip="Activate" Style="vertical-align: middle;"
                              CommandName="activate" CommandArgument='<%# Eval("BannerId")%>' runat="server"
                              OnClientClick="return confirm('Please confirm if you want to activate banner')"
                              ImageUrl="~/images/admin/action_icon/logout.png" />
                        </ItemTemplate>
                     </asp:TemplateField>
                  </Columns>
               </asp:GridView>
            </div>
         </ContentTemplate>
      </asp:UpdatePanel>
      <div class="button_group">
         <div class="row">
            <div class="col-sm-6 col-lg-5">
                <asp:Button ID="btnBannerUpload" ClientIDMode="Static" Text="Upload New"
                  runat="server" onclick="btnBannerUpload_Click" style="display:none;" />
               <asp:FileUpload runat="server" ID="fuBanner" ClientIDMode="Static" style="display:none;" onchange="$('#btnBannerUpload').click()"/>
               <asp:Button CssClass="btn btn-default" ID="btnBannerFile" Text="Upload New"
                  runat="server" OnClientClick="$('#fuBanner').click(); return false;" />
            </div>
            <div class="col-sm-6 col-lg-7">
               
            </div>
         </div>
      </div>
      </div>
   </div>
   <div class="col-sm-6 col-md-6 col-lg-4">
      <div class="display_inputbox_panel">
         <asp:UpdatePanel runat="server" ID="upWelcomeNote" UpdateMode="Conditional" OnLoad="upWelcomeNote_Load">
            <ContentTemplate>
               <h4>
                  Welcome Note</h4>
               <div class="display_inputbox_content">
                  <div class="form-group">
                     <label for="inputname" class="col-sm-4 col-md-3 control-label custom_label">
                        Message</label>
                     <div class="col-sm-8 col-md-9">
                        <asp:TextBox CssClass="form-control" ID="txtWelcomeNote" runat="server" TextMode="MultiLine"
                           Rows="5" ValidationGroup="WelcomeNote" />
                     </div>
                  </div>
               </div>
               <div class="button_group">
                  <asp:Button CssClass="btn btn-success" ID="btnSaveWelcomeNote" ValidationGroup="WelcomeNote"
                     Text="Save" runat="server" OnClick="btnSaveWelcomeNote_Click" />
                  <asp:Button CssClass="btn btn-info" ID="btnCancelWelcomeNote" Text="Cancel" runat="server"
                     OnClick="btnCancelWelcomeNote_Click" />
               </div>
            </ContentTemplate>
            <Triggers>
               <asp:AsyncPostBackTrigger ControlID="btnSaveWelcomeNote" EventName="Click" />
               <asp:AsyncPostBackTrigger ControlID="btnCancelWelcomeNote" EventName="Click" />
            </Triggers>
         </asp:UpdatePanel>
      </div>
   </div>
   </div>
   <!--start tabel conetnt-->
   <div class="admin_table_container">
      <h3>Recent Scenes</h3>
      <asp:UpdatePanel ID="upRecentScene" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
            <div class="table-responsive">
               <asp:GridView ID="grid" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                  AllowPaging="False" PageSize="20" OnRowDataBound="grid_RowDataBound" OnRowCommand="grid_Command">
                  <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"
                     FirstPageText="<<" LastPageText=">>" />
                  <Columns>
                     <asp:TemplateField>
                        <HeaderTemplate>
                           <asp:CheckBox ID="chbAll" runat="server" AutoPostBack="true" OnCheckedChanged="chbAll_CheckChanged" />
                        </HeaderTemplate>
                        <ItemTemplate>
                           <asp:HiddenField ID="hidId" Value='<%#Eval("RecentSceneId")%>' runat="server" />
                           <asp:CheckBox runat="server" Checked='<%#Eval("Selected")%>' ID="cbSelected" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Title/Description">
                        <ItemTemplate>
                           <asp:Label ID="lblRecentSceneTitle" Text='<%# Eval("RecentSceneTitle") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Preview Video File">
                        <ItemTemplate>
                           <asp:Label ID="lblRecentSceneFileName" Text='<%# Eval("RecentSceneFileName") %>'
                              runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                           <asp:Label ID="lblStatus" Text='<%# Eval("Status") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Action">
                        <ItemTemplate>
                           <a href='javascript:void(0)' onclick="javascript:createUpdateForm(<%#Eval("RecentSceneId")%>);">
                              <img src="<%=ResolveClientUrl("~") %>images/admin/action_icon/edit_icon.png" alt="" title="Edit"
                                 border="0" />
                           </a>
                           <asp:ImageButton runat="server" ImageUrl="~/images/admin/action_icon/delete_icon.gif" ToolTip="Delete"
                              Style="vertical-align: middle;" ID="lbtnDelete" OnCommand="grid_Command" CommandName="delete"
                              CommandArgument='<%# Eval("RecentSceneId")%>' OnClientClick="return confirm('Please confirm if you want to delete scene')" />
                           <asp:ImageButton ID="btnDeactivate" OnCommand="grid_Command" ToolTip="Deactivate"
                              Style="vertical-align: middle;" CommandName="deactivate" CommandArgument='<%# Eval("RecentSceneId")%>'
                              runat="server" OnClientClick="return confirm('Please confirm if you want to deactivate scene')"
                              ImageUrl="~/images/admin/action_icon/deactive.png" />
                           <asp:ImageButton ID="btnActivate" OnCommand="grid_Command" ToolTip="Activate" Style="vertical-align: middle;"
                              CommandName="activate" CommandArgument='<%# Eval("RecentSceneId")%>' runat="server"
                              OnClientClick="return confirm('Please confirm if you want to activate scene')"
                              ImageUrl="~/images/admin/action_icon/logout.png" />
                        </ItemTemplate>
                     </asp:TemplateField>
                  </Columns>
               </asp:GridView>
            </div>
         </ContentTemplate>
      </asp:UpdatePanel>
      <div class="button_group">
         <div class="row">
            <div class="col-sm-6 col-lg-5">
               <asp:Button CssClass="btn btn-default" ID="btnDeleteSelected" OnClientClick="return confirm('Please confirm if you want to delete selected scenes')"
                  Text="Delete Selected" runat="server" OnClick="btnDeleteSelected_Click" />
               <asp:Button CssClass="btn btn-default" ID="btnActivateSelected" OnClientClick="return confirm('Please confirm if you want to activate selected scenes')"
                  Text="Activate Selected" runat="server" OnClick="btnActivateSelected_Click" />
               <asp:Button CssClass="btn btn-default" ID="btnDeactivateSelected" OnClientClick="return confirm('Please confirm if you want to deactivate selected scenes')"
                  Text="Deactivate Selected" runat="server" OnClick="btnDeactivateSelected_Click" />
            </div>
            <div class="col-sm-6 col-lg-7">
               <asp:Button CssClass="btn btn-default" ID="btnReverseSelected" Text="Reverse Selected"
                  runat="server" OnClick="btnReverseSelected_Click" />
               <asp:Button CssClass="btn btn-default" ID="btnRecentSceneUpload" Text="Upload New"
                  runat="server" OnClientClick="createUpdateForm(-1); return false;" />
            </div>
         </div>
      </div>
   </div>
   <!--end tabel conetnt-->
   <div id="editDialog">
      <asp:UpdatePanel runat="server" ID="upDetails" OnLoad="upDetails_Load" UpdateMode="Conditional"
         ClientIDMode="Static">
         <ContentTemplate>
            <div>
               <div class="fieldset_block col-lg-12 page_area">
                  <fieldset>
                     <legend><h4><asp:Label runat="server" ID="lblDialogTitle"></asp:Label></h4></legend>
                     <asp:Label runat="server" ID="hdId" Style="display: none;" />
                     <div class="fieldset_cotent form-horizontal">
                        <div class="row">
                           <div class="col-lg-12">
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Title/Description</label>
                                 <div class="col-lg-8">
                                    <asp:TextBox CssClass="form-control" placeholder="Title/Description" ID="txtRecentSceneTitle"
                                       ValidationGroup="newItem" runat="server" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtRecentSceneTitle"
                                       runat="server" Text="*" ValidationGroup="newItem" ForeColor="Red" Display="Dynamic" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Preview Video File</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuRecentSceneFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Preview Video Poster</label>
                                 <div class="col-lg-8">
                                    <asp:Panel runat="server" ID="pnlPoster">
                                        <asp:Label runat="server" ID="lblPoster"></asp:Label>
                                        <a href="javascript:void(0)" onclick="ShowFU('<%= pnlPoster.ClientID %>', '<%= fuPoster.ClientID %>', '<%= hdPoster.ClientID %>')">Delete</a>
                                        <asp:HiddenField runat="server" ID="hdPoster" />
                                    </asp:Panel>
                                    <asp:FileUpload runat="server" ID="fuPoster" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">State</label>
                                 <div class="col-lg-8">
                                    <asp:DropDownList CssClass="form-control" ID="ddlIsActive" runat="server">
                                       <asp:ListItem Text="Active" Value="1"></asp:ListItem>
                                       <asp:ListItem Text="Deactivate" Value="0"></asp:ListItem>
                                    </asp:DropDownList>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <div class="button_group">
                           <asp:Button CssClass="btn btn-success" ID="btnSave" ValidationGroup="newItem" Text="Save" OnClientClick="BlockInt('Saving data...');"
                              runat="server" OnClick="btnSave_Click" ClientIDMode="Static" />
                           <asp:Button CssClass="btn btn-info" ID="btnCancel" Text="Cancel" runat="server" OnClientClick="$('#editDialog').dialog('close'); return false;"
                              ClientIDMode="Static" />
                        </div>
                     </div>
                  </fieldset>
               </div>
            </div>
         </ContentTemplate>
         <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
         </Triggers>
      </asp:UpdatePanel>
   </div>

   <div id="editNextLiveShow">
      <asp:UpdatePanel runat="server" ID="upNextLiveShowDetails" OnLoad="upNextLiveShowDetails_Load" UpdateMode="Conditional" ClientIDMode="Static">
         <ContentTemplate>
               <div class="fieldset_block col-lg-12 page_area">
                  <fieldset>
                     <legend><h4><asp:Label runat="server" ID="lblNextLiveShowDialogTitle"></asp:Label></h4></legend>
                     <asp:Label runat="server" ID="hdNextLiveShowId" Style="display: none;" />
                     
                     <div class="fieldset_cotent form-horizontal">
                        <div class="row">
                           <div class="col-lg-12">
                                <div class="form-group">
                                    <label class="col-lg-4 control-label">Name</label>
                                    <div class="col-lg-8">
                                        <asp:TextBox CssClass="form-control" placeholder="Name" ID="txtNextLiveShowName" ValidationGroup="newShow" runat="server" />
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtNextLiveShowName"
                                            runat="server" Text="*" ValidationGroup="newShow" ForeColor="Red" Display="Dynamic" />
                                    </div>
                                </div>
                                        
                                <div class="form-group">
                                    <label class="col-lg-4 control-label">Date</label>
                                    <div class="col-lg-8">     
                                        <div class="input-group">   
                                            <asp:TextBox ID="txtNextLiveShowDate" CssClass="form-control" ValidationGroup="newShow" runat="server"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button class="btn btn-default" type="button" id="btnShowDate">
                                                    <img src="<%=ResolveClientUrl("~") %>images/admin/calander_icon.png" alt="calander" title="Calander" />
                                                </button>
                                            </span>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtNextLiveShowDate"
                                                runat="server" Text="*" ValidationGroup="newShow" ForeColor="Red" Display="Dynamic" />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-lg-4 control-label">Time</label>
                                    <div class="col-lg-8">     
                                        <div class="input-group">   
                                            <asp:TextBox ID="txtNextLiveShowTime" CssClass="form-control" ValidationGroup="newShow" runat="server"></asp:TextBox>
                                            <span class="input-group-btn">
                                                <button class="btn btn-default" type="button" id="btnShowTime">
                                                    <img src="<%=ResolveClientUrl("~") %>images/admin/clock_icon.png" alt="calander" title="Calander" />
                                                </button>
                                            </span>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtNextLiveShowTime"
                                                runat="server" Text="*" ValidationGroup="newShow" ForeColor="Red" Display="Dynamic" />
                                    </div>
                                </div>
                                <div class="form-group">
                                 <label class="col-lg-4 control-label">State</label>
                                 <div class="col-lg-8">
                                    <asp:DropDownList CssClass="form-control" ID="ddlNextLiveShowState" runat="server">
                                       <asp:ListItem Text="Active" Value="1"></asp:ListItem>
                                       <asp:ListItem Text="Deactivate" Value="0"></asp:ListItem>
                                    </asp:DropDownList>
                                 </div>
                                </div>
                                <div class="form-group">
                                    <asp:Label runat="server" ID="lblNexLiveShowMessage" ForeColor="Red" CssClass="col-lg-12 control-label" Text=""/>
                                </div>
                           </div>
                        </div>
                        <div class="button_group">
                           <asp:Button CssClass="btn btn-success" ID="btnNextLiveShowSave" ValidationGroup="newShow" Text="Save" runat="server" OnClick="btnNextLiveShowSave_Click" ClientIDMode="Static" />
                           <asp:Button CssClass="btn btn-info" ID="btnNextLiveShowCancel" Text="Cancel" runat="server" OnClientClick="$('#editNextLiveShow').dialog('close'); return false;" ClientIDMode="Static" />
                        </div>
                     </div>
                  </fieldset>
               </div>
         </ContentTemplate>
         <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnNextLiveShowSave" EventName="Click" />
         </Triggers>
      </asp:UpdatePanel>
   </div>

</asp:Content>
